import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';

class ListViewLn extends StatefulWidget {
  const ListViewLn({super.key});

  @override
  State<ListViewLn> createState() => _ListViewLnState();
}

class _ListViewLnState extends State<ListViewLn> {
  String str = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";

  @override
  Widget build(BuildContext context) {
    return Scaffold(
        appBar: AppBar(
          title: Text(
            "ListView", // 设置标题文本
            style: TextStyle(
              color: Colors.white, // 设置标题字体颜色
            ),
          ),
          iconTheme: IconThemeData(
            color: Colors.white, // 设置返回图标颜色
          ),
          backgroundColor: Colors.deepPurple, // 设置AppBar背景颜色
        ),
        body: ListView(
          shrinkWrap: true,
          padding: const EdgeInsets.all(20.0),
          children: str
              .split("")
              //每一个字母都用一个Text显示,字体为原来的两倍
              .map((c) => Text(
                    c,
                    textScaleFactor: 2.0,
                  ))
              .toList(),
        ));
  }
}
